package com.nmgs.common;

import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 *
 */
/**
 * @author: shuguang
 * @date: 2022年10月15日 16:27
 * @description: 业务自定义异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PPException extends RuntimeException{
    /**
     * 异常代码
     */
    private String errorCode;
    /**
     * 异常信息
     */
    private String errorMessage;

    public PPException(String errorCode, String errorMessage) {
        super(errorCode);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public PPException(String message, String errorCode, String errorMessage) {
        super(message);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public PPException(String message, Throwable cause, String errorCode, String errorMessage) {
        super(message, cause);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public PPException(Throwable cause, String errorCode, String errorMessage) {
        super(cause);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public PPException(int code, String 参数不能为空) {
    }
}
